#define _CRT_SECURE_NO_WARNINGS
#include "12.9_hs.h"

void test1()
{
	const int n = 9;
	int* pi = &n;
	*pi = 7;
	printf("%d", *pi);
	int const m = 1;
	//m = 2;//no
	int* pm = &m;
	*pm = 7;
	printf(" %d", *pm);
}

void test2()
{
	const int n = 10;
	const int m = 20;
	const int* pn = &n;
	const int* pm = &m;
	/**pn = 20;//no
	*pm = 10;*///no
	pn = &m;
	pm = &n;
	printf("*pn = %d, *pm = %d", *pn, *pm);
}

void test3()
{
	const int n = 10;
	int const m = 20;
	int* const pn = &n;
	int* const pm = &m;
	*pn = 20;
	*pm = 10;
	printf("%d %d", *pn, *pm);
	/*pn = &m;//no
	pm = &n;*///no
}

void test4()
{
	int n = 10;
	int m = 20;
	const int* const pn = &n;
	int const* const pm = &m;
	/**pn = 1;//all no
	*pm = 7;
	pn = &m;
	pm = &n;*/
}

void Print_int_sz(int* p, int sz)
{
	for (int i = 0; i < sz; i++)
	{
		printf("%d ", *(p + i));
		//printf("%d ", p[i]);
	}
	printf("\n");
}

int My_strlen(char* p)
{
	char* c = p;
	while (*(p))
	{
		p++;
	}
	return p - c;
	//return c - p;
}

void Print_char_sz(char* p, int sz)
{
	char* f = p;
	while (f < p + sz)
	{
		printf("%c ", *f);
		f++;
	}
}